/*
//	CP2013 Traffic Simulator Assignment :: (MVC) Model :: Direction Class (Header File)
//	Copyright (c) 2010, Adam Rehn
//
//	This class represents an (x,y) vector to be used for directions.
*/

#ifndef _MODEL_DIRECTION_H
#define _MODEL_DIRECTION_H

//Defines for the default directions
#define DIRECTION_UNDEFINED direction_t(0,  0)
#define DIRECTION_NORTH     direction_t(0,  -1)
#define DIRECTION_WEST      direction_t(-1, 0)
#define DIRECTION_EAST      direction_t(1,  0)
#define DIRECTION_SOUTH     direction_t(0,  1)

class direction_t
{
	public:
		direction_t(int x = 0, int y = 0);
		int x;
		int y;
};

//Directions can also be used as coordinates
typedef direction_t coordinate;

//Overloaded comparison operators for directions
bool operator==(direction_t left, direction_t right);
bool operator!=(direction_t left, direction_t right);

//Overloaded multiplication operator for directions
direction_t operator*(direction_t dir, int multiplyBy);
direction_t operator*(int multiplyBy,  direction_t dir);

#endif
